<?php

/*
|--------------------------------------------------------------------------
| Admin Routes
|--------------------------------------------------------------------------
|
| This file is where you may override any of the routes that are included
| with Voyager.
|
*/

Route::group(['as' => 'admin.','prefix'=>'admin'], function () {
    event('admin.routing', app('router'));

    $namespacePrefix = '\\App\\Admin\\Controllers\\';

    Route::get('login', ['uses' => $namespacePrefix . 'AuthController@login', 'as' => 'login']);
    Route::post('login', ['uses' => $namespacePrefix . 'AuthController@postLogin', 'as' => 'postlogin']);

    Route::group(['middleware' => ['admin.user']], function () use ($namespacePrefix) {
        // Main Admin and Logout Route
        Route::get('/', ['uses' => $namespacePrefix . 'IndexController@index', 'as' => 'dashboard']);
        Route::get('logout', ['uses' => $namespacePrefix . 'IndexController@logout', 'as' => 'logout']);

        Route::post('upload', ['uses' => $namespacePrefix . 'IndexController@upload', 'as' => 'upload']);
        

    });

});